const koa = require('koa');
const staticCache = require('koa-static-cache');
const pathlib = require('path');

let server = new koa();
server.listen(8080);

server.use(staticCache(               // 相对路径解析为绝对路径
    pathlib.resolve('www')
))